const UglifyJS = require("uglify-js");  
const fs = require("fs");  
  
/* 压缩文件 */

const code = fs.readFileSync("jsonbin.js", "utf8");  
const minified = UglifyJS.minify(code);  
  
fs.writeFileSync("jsonbin.min.js", minified.code);